package com.siashan.sensitive;


import java.lang.annotation.*;

/**
 * <p>
 * 敏感词检测注解
 * <p>
 *
 * @author siashan
 * @date 2023/5/23
 * @since 1.2.1
 */
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface SensitiveCheck {

    /**
     * 敏感词操作 默认抛异常
     * @return
     */
    SensitiveCheckStrategy type() default SensitiveCheckStrategy.THROW_ERROR;


    /**
     * 抛异常时 提示语
     * @return
     */
    String throwErrorMsg() default "您提交的信息中包含敏感词$sensitiveWord$，内容不能发布，请修改之后再提交";

    /**
     * 抛异常时 是否显示敏感词
     * @return
     */
    boolean throwErrorShowWord() default true;

}
